package com.imooc.sellspringcloud.server.redis;

/**
 * @author
 * @create 2019-08-07 20:19
 **/
public class BaseKeyPreFix implements KeyPrefix {

    public int expireSeconds;

    public String prefix;

    public BaseKeyPreFix(String prefix){
        this(0, prefix);
    }

    public BaseKeyPreFix(int expireSeconds, String prefix) {
        this.expireSeconds = expireSeconds;
        this.prefix = prefix;
    }

    @Override
    public int expireSeconds() {
        return expireSeconds;
    }

    @Override
    public String getPrefix() {
        String simpleName = getClass().getSimpleName();
        return simpleName + ":" + prefix;
    }
}